<#assign title="projects" />
<#assign activeTitle="env" />
<#include "/frag.head.ftl">
<div class="row">
  <div class="col-xs-12">
    <div id="toolbar"></div>
  </div>
  <div class="col-xs-12">
    <table id="dataGrid"></table>
  </div>
</div>
<#include "/frag.foot.ftl">

<script type="text/javascript">

  $(document).ready(function () {

    $("#dataGrid").bootstrapTable({
      data: ${envs_json},
      striped: false,
      uniqueId: 'name',
      searchable: true,
      paginationHAlign: 'left',
      paginationDetailHAlign: 'right',
      paginationLoop: false,
      sortable: true,
      searchAlign: 'left',
      pagination: true,
      sidePagination: 'client',
      pageSize: 10,
      showFullscreen: true,
      pageList: [10, 20, 50, 'ALL'],
      search: true,

      columns: [{
        field: 'name',
        title: '名称',
        align: 'left',
        valign: 'middle',
        formatter: function (v, row, index) {
          return '<i class="fa fa-object-ungroup"></i>' + v;
        }
      }, {
        field: 'caption',
        title: '描述',
        align: 'left',
        valign: 'middle'
      }, {
        title: "操作",
        align: 'center',
        valign: 'middle',
        width: 160,
        formatter: function (v, row, index) {
          var actions = [];
          actions.push('<button class="btn btn-success btn-sm" onclick="publishEnv(\'' + row.name + '\');">Publish</button>&nbsp;');
          return actions.join('');
        }
      }
      ]
    });
  });
</script>